﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:props="clr-namespace:ScrumFactory.Windows.Properties"                    
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:SF_Converters="clr-namespace:ScrumFactory.Windows.Helpers.Converters;assembly=ScrumFactory.Windows.Helpers">


    
    
    <FontFamily x:Key="WideFont">Segoe UI</FontFamily>
    
    
    <!-- FONT SIZES -->
    <sys:Double x:Key="TinyFontSize">10</sys:Double>
    <sys:Double x:Key="SmallFontSize">12</sys:Double>
    <sys:Double x:Key="NormalFontSize">14</sys:Double>
    <sys:Double x:Key="BigFontSize">16</sys:Double>
    <sys:Double x:Key="MuchBiggerFontSize">18</sys:Double>
    <sys:Double x:Key="ReallyBigFontSize">23</sys:Double>
    
    <Style TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <!--<Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>        
        <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>-->
    </Style>

   

    <Style x:Key="TitleTextBlock" TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="24"/>
        <Setter Property="Foreground" Value="{StaticResource TitleTextBrush}"/>
        <Setter Property="Margin" Value="0,0,0,20"/>
    </Style>



    <Style x:Key="PanelMainTitle" TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="48"/>
        <Setter Property="Opacity" Value="0.3"/>
        <Setter Property="Foreground" Value="{StaticResource MainTitleTextBrush}"/>

    </Style>

    <Style x:Key="PanelSubTitle" TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="12"/>        
        <Setter Property="Foreground" Value="{StaticResource TitleTextBrush}"/>
    </Style>

    <Style TargetType="{x:Type Hyperlink}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>
        <Setter Property="Foreground" Value="{StaticResource LinkBrush}"/>        
        <Setter Property="TextDecorations" Value="None"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="TextDecorations" Value="Underline"/>
            </Trigger>
        </Style.Triggers>        
    </Style>

    <Style x:Key="HyperLinkTextBlock" TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>
        <Setter Property="Foreground" Value="{StaticResource LinkBrush}"/>
        <Setter Property="TextDecorations" Value="None"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="TextDecorations" Value="Underline"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="IndicatorTextBlock" TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="Foreground" Value="{StaticResource NormalIndicatorBrush}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding .}" Value="1">
                <Setter Property="Foreground" Value="{StaticResource AttentionIndicatorBrush}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="2">
                <Setter Property="Foreground" Value="{StaticResource OverIndicatorBrush}"/>
            </DataTrigger>
        </Style.Triggers>
        
    </Style>



    <Style x:Key="LabelHelp" TargetType="{x:Type TextBlock}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="{StaticResource SmallFontSize}"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="Margin" Value="0,3,0,8"/>
        <Setter Property="Foreground" Value="Gray"/>
        <Setter Property="FontWeight" Value="Normal"/>

    </Style>



    <ControlTemplate x:Key="DefaultErrorTemplate">
        <DockPanel DataContext="{Binding ElementName=adorner, Path=AdornedElement.(Validation.Errors)/ErrorContent}">
            <!--<Ellipse x:Name="Ellipse"
                     DockPanel.Dock="Right"
                     Margin="2,0,2,0"
                     Width="14"
                     Height="14"
                     VerticalAlignment="Center" 
                     Stroke="#40000000" StrokeThickness="2" Fill="Red">
                <Ellipse.ToolTip>
                    <Border MaxWidth="350">
                        <ContentControl FontSize="14" Content="{Binding}"/>
                    </Border>
                </Ellipse.ToolTip>
            </Ellipse>-->
            <Border BorderThickness="0" CornerRadius="3" IsHitTestVisible="False">               
                <Border.Background>
                    <SolidColorBrush Color="{StaticResource Red2Color}" Opacity="0.4"/>
                </Border.Background>
                <AdornedElementPlaceholder Margin="-1" Name="adorner"/>
            </Border>
        </DockPanel>
    </ControlTemplate>




    <Style TargetType="TextBox">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="{StaticResource BigFontSize}"/>
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="Padding" Value="2,4,2,4"/>
        <Setter Property="Margin" Value="3"/>
        <Setter Property="Background" Value="{StaticResource TextBoxBackgroundBrush}"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource DefaultErrorTemplate}" />
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="HorizontalAlignment" Value="left"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Border                             
                        Name="Border"
                        CornerRadius="3" 
                        Margin="{TemplateBinding Margin}"
                        Padding="{TemplateBinding Padding}"         
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}" >
                        <Grid>
                            <Border 
                                    x:Name="disableBorder"
                                    Background="White" Opacity="0.3" Visibility="Collapsed"
                                    CornerRadius="3"/>
                                    
                            <TextBlock                                  
                                    x:Name="tooltipTextBlock"
                                    VerticalAlignment="Top" Margin="0"
                                    FontSize="{TemplateBinding TextBox.FontSize}" FontFamily="{TemplateBinding FontFamily}" FontStyle="Italic"
                                    Text="{TemplateBinding ToolTip}"  Foreground="LightGray">
                                <TextBlock.Style>
                                    <Style>
                                        <Setter Property="TextBlock.Visibility" Value="Collapsed"/>    
                                    </Style>                                                
                                </TextBlock.Style>
                            </TextBlock>
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost"
                                      TextBlock.FontFamily="{TemplateBinding FontFamily}"
                                      TextBlock.FontSize="{TemplateBinding TextBox.FontSize}"/>
                        </Grid>                        
                    </Border>
                    <ControlTemplate.Triggers>                        
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="TextBox.IsKeyboardFocusWithin" Value="False"/>
                                <Condition Property="TextBox.Text" Value=""/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="tooltipTextBlock" Property="TextBlock.Visibility" Value="Visible"/>
                        </MultiTrigger>
                        <Trigger Property="ToolTip" Value="{x:Null}">
                            <Setter TargetName="tooltipTextBlock" Property="TextBlock.Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">                            
                            <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderOverBrush}"/>                            
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderFocusedBrush}"/>
                        </Trigger>
                        <Trigger Property="IsReadOnly" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="Transparent"/>                            
                            <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderReadOnlyBrush}"/>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="Foreground" Value="Black"/>                            
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <!--<Setter TargetName="Border" Property="Background" Value="LightGray"/>                            
                            <Setter Property="Foreground" Value="Black"/>-->
                            <Setter TargetName="disableBorder" Property="Visibility" Value="Visible"/>
                        </Trigger>
                        
                      

                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

    <Style x:Key="ClickToEditTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">                
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Background" Value="Transparent"/>
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderFocusedBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="CleanTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Style.Triggers>
            <Trigger Property="IsReadOnly" Value="True">                
                <Setter Property="BorderBrush" Value="Transparent"/>                
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="PasswordBox">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontSize" Value="{StaticResource BigFontSize}"/>
        <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}"/>
        <Setter Property="Background" Value="{StaticResource TextBoxBackgroundBrush}"/>
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource DefaultErrorTemplate}" />
        <Setter Property="Margin" Value="3"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="HorizontalAlignment" Value="left"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <Border                             
                        Name="Border"
                        CornerRadius="3" 
                        Margin="{TemplateBinding Margin}"
                        Padding="2,4,2,4"         
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="2" >
                        <Grid>
                            <TextBlock                                  
                                    x:Name="tooltipTextBlock"
                                    VerticalAlignment="Center" Margin="0"
                                    FontSize="{TemplateBinding TextBox.FontSize}" FontFamily="{TemplateBinding FontFamily}" FontStyle="Italic"
                                    Text="{TemplateBinding ToolTip}"  Foreground="LightGray">
                                <TextBlock.Style>
                                    <Style>
                                        <Setter Property="TextBlock.Visibility" Value="Collapsed"/>    
                                    </Style>                                                
                                </TextBlock.Style>
                            </TextBlock>
                            <ScrollViewer Margin="0" x:Name="PART_ContentHost"
                                      TextBlock.FontFamily="{TemplateBinding FontFamily}"
                                      TextBlock.FontSize="{TemplateBinding TextBox.FontSize}"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="TextBox.IsKeyboardFocusWithin" Value="False"/>
                                <Condition Property="TextBox.Text" Value=""/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="tooltipTextBlock" Property="TextBlock.Visibility" Value="Visible"/>
                        </MultiTrigger>
                        <Trigger Property="ToolTip" Value="{x:Null}">
                            <Setter TargetName="tooltipTextBlock" Property="TextBlock.Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderOverBrush}"/>
                        </Trigger>
                        
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="LightGray"/>
                            <Setter Property="Foreground" Value="Black"/>
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderFocusedBrush}"/>
                        </Trigger>


                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

    <Style x:Key="HyperLinkTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="TextDecorations" Value="Underline"/>
        <Setter Property="Foreground" Value="{StaticResource LabelBrush}"/>        
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderFocusedBrush}"/>
                <Setter Property="TextDecorations" Value="{x:Null}"/>
                <Setter Property="Foreground" Value="Black"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="SearchTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">        
        
        <Style.Triggers>
            <Trigger Property="IsKeyboardFocusWithin" Value="True">
                <Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderFocusedBrush}"/>
                <Setter Property="Background" Value="{StaticResource SearchTextBoxBackgroundBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="LabelTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
        <Setter Property="Foreground" Value="{StaticResource LabelBrush}"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="Margin" Value="3"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
    </Style>

    <Style x:Key="ItemTitleTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="FontSize" Value="{StaticResource BigFontSize}"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
    </Style>

    <Style x:Key="ItemGroupTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="Foreground" Value="{StaticResource ItemGroupBrush}"/>
        <Setter Property="FontWeight" Value="SemiBold"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="FontSize" Value="{StaticResource BigFontSize}"/>

    </Style>


    <Style x:Key="dayAllocationTextBlock" TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
        <Setter Property="Text" Value="{x:Static props:Resources.dayNull_allocation}"/>
        <Style.Triggers>            
            <DataTrigger Binding="{Binding .}" Value="1">
                <Setter Property="Text" Value="{x:Static props:Resources.day14_allocation}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="2">
                <Setter Property="Text" Value="{x:Static props:Resources.day12_allocation}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="3">
                <Setter Property="Text" Value="{x:Static props:Resources.day34_allocation}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding .}" Value="4">
                <Setter Property="Text" Value="{x:Static props:Resources.day44_allocation}"/>
            </DataTrigger>
        </Style.Triggers>

    </Style>


    <Style x:Key="BacklogItemGroupTextBlock" TargetType="TextBlock">
        <Setter Property="Padding" Value="2"/>
        <Setter Property="TextTrimming" Value="CharacterEllipsis"/>
        <Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>        
        <Setter Property="Foreground" Value="Black"/>
        <Style.Triggers>
            <Trigger Property="Background" Value="Black">
                <Setter Property="Foreground" Value="White"/>
            </Trigger>
            <Trigger Property="Background" Value="MediumSeaGreen">
                <Setter Property="Foreground" Value="PaleGreen"/>
            </Trigger>
            <Trigger Property="Background" Value="PaleGreen">
                <Setter Property="Foreground" Value="OliveDrab"/>
            </Trigger>
            <Trigger Property="Background" Value="OliveDrab">
                <Setter Property="Foreground" Value="PaleGreen"/>
            </Trigger>
            <Trigger Property="Background" Value="Crimson">
                <Setter Property="Foreground" Value="Pink"/>
            </Trigger>
            <Trigger Property="Background" Value="CornflowerBlue">
                <Setter Property="Foreground" Value="LightBlue"/>
            </Trigger>
            <Trigger Property="Background" Value="LightBlue">
                <Setter Property="Foreground" Value="DarkBlue"/>
            </Trigger>
            <Trigger Property="Background" Value="Gold">
                <Setter Property="Foreground" Value="Brown"/>
            </Trigger>
            <Trigger Property="Background" Value="Khaki">
                <Setter Property="Foreground" Value="Brown"/>
            </Trigger>            
        </Style.Triggers>
    </Style>



</ResourceDictionary>